package com.ruibei.ui;


import java.io.FileNotFoundException;
import java.net.URI;

import android.content.ContentResolver;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
import android.view.MotionEvent;
import android.widget.ImageView;
import butterknife.ButterKnife;
import butterknife.InjectView;

import com.ruibei.R;
import com.ruibei.utils.BitmapUtil;
import com.ruibei.view.ImageLoadingDialog;

/**
 * 
 * @author wu
 *	显示大图片页面
 */
public class ShowLargeImageActivity extends BaseActivity {
	
	@InjectView(R.id.show_large_image)
	ImageView show_large_image;
	
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.image_show);
        ButterKnife.inject(this);
        
        String  url = (String) getIntent().getExtras().get("uri");
        Bitmap bmp = BitmapUtil.getScaleBitmap(url);
	    show_large_image.setImageBitmap(bmp);
       
       
        final ImageLoadingDialog dialog = new ImageLoadingDialog(this);
        dialog.show();
        // 两秒后关闭后dialog
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                dialog.dismiss();
            }
        }, 1000 * 2);
    }

    @Override
    public boolean onTouchEvent(MotionEvent event) {
        // TODO Auto-generated method stub
        finish();
        return true;
    }

}